package cn.wolfcode.trip.app.controller;

import cn.wolfcode.trip.base.query.TravelCommendQueryObject;
import cn.wolfcode.trip.base.service.ITravelCommendService;
import com.github.pagehelper.PageInfo;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.*;

@RestController
@RequestMapping("/travelComments")
public class TravelCommendController {

    @Autowired
    public ITravelCommendService travelCommendService;

    /**
     * 根据推荐类型获取推荐列表
     * @param qo 推荐类型
     * @return
     */
    @GetMapping
    public PageInfo listComment(@ModelAttribute("qo") TravelCommendQueryObject qo){
        //根据排序
        qo.setOrderBy("schedule DESC");
        return travelCommendService.queryForApp(qo);
    }


}
